package com.mida.dms.knw.entity;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(description = "授权空间用户")
@AllArgsConstructor
@NoArgsConstructor
public class DtUseSpaceConsumer implements Serializable {

    @ApiModelProperty(value = "授权空间用户soid")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long spaceConsumerSoid;

    @ApiModelProperty(value = "授权空间soid")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long useSpaceSoid;

    @ApiModelProperty(value = "医生soid")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long doctorSoid;

    @ApiModelProperty(value = "状态")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long status;

    @ApiModelProperty("删除标志位")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isDelete;

    @ApiModelProperty(value = "创建日期时间")
    private Date createDate;

    @ApiModelProperty(value = "最后修改日期时间")
    private Date updateDate;

    @ApiModelProperty(value = "最后修改人")
    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long updateUser;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof DtUseSpaceConsumer)) return false;

        DtUseSpaceConsumer that = (DtUseSpaceConsumer) o;

        return getDoctorSoid() != null ? getDoctorSoid().equals(that.getDoctorSoid()) : that.getDoctorSoid() == null;
    }

    @Override
    public int hashCode() {
        return getDoctorSoid() != null ? getDoctorSoid().hashCode() : 0;
    }
}